package com.consumer;

import com.common.model.User;
import com.common.service.UserService;
import com.rpc.RpcApplication;
import com.rpc.bootstrap.ConsumerBootstrap;
import com.rpc.config.RpcConfig;
import com.rpc.proxy.ServiceProxyFactory;
import com.rpc.registry.LocalRegistry;
import com.rpc.utils.ConfigUtils;

public class ConsumerExample {
    public static void main(String[] args) {
        //服务提供者初始化
        ConsumerBootstrap.init();

        //获取代理对象
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("jiajia");
        User newUser = userService.getUser(user);
        long number = userService.getNumber();
        System.out.println(number);
    }

}
